module ApplicationHelper
  # 定义错误码
  def ApplicationHelper.codes(code = 0)
    codes = {
      "0" => "操作成功",
      "40000" => "操作失败",
      "40001" => "用户名不能为空",
    }
    return codes[code.to_s]
  end

  # def paginate_meta_attributes(json, object)
  #   json.(object,
  #     :current_page,
  #     :next_page,
  #     :prev_page,
  #     :total_pages,
  #     :total_count
  #   )
  # end

  def format_time(time)
    return time.strftime('%Y-%m-%d')
  end
end